package invoke

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

//func TestInvokeUrl(t *testing.T) {
//	callMessage := &model.CallMessage{
//		GroupName:    "default",
//		FunctionName: "test-python3",
//		VersionName:  "LATEST",
//		Event:        "",
//		Id:    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
//		Host:         "http://ingress.cn-south-1.fcs.yuchunyu.me:9000",
//	}
//	result, err := CallFunction(callMessage)
//	if err != nil {
//		t.Error(err)
//	}
//	t.Log(result)
//}

//func TestCallFunction(t *testing.T) {
//	Convey("测试发送请求", t, func() {
//		Patch(client.Client.Request, func(client.Client, context.Context, event.Event) (*event.Event, protocol.Result) {
//			return &event.Event{}, protocol.ResultACK
//		})
//		Patch(cloudevents.IsACK, func(target protocol.Result) bool {
//			return true
//		})
//		Patch(event.Event.Extensions, func(event.Event) map[string]interface{} {
//			return map[string]interface{}{
//				"fcrequestid":      "abc",
//				"fcmaxmemoryusage": "23232",
//				"fclog":            "log",
//				"fcduration":       "22",
//				"fcstatus":         "1",
//				"fccodechecksum":   "abcde",
//			}
//		})
//		callMessage := &model.CallMessage{
//			GroupName:    "default",
//			FunctionName: "test-python3",
//			VersionName:  "LATEST",
//			Event:        "",
//			Id:    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
//			Host:         "http://ingress.cn-south-1.fcs.yuchunyu.me:9000",
//		}
//		_, err := CallFunction(callMessage)
//		So(err, ShouldBeNil)
//	})
//}

func TestMessages(t *testing.T) {
	result := Messages("aaa")
	assert.NotNil(t, result)
}
